package com.cx.mall.demo.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;


import java.sql.SQLException;
import java.util.List;
@Mapper
public interface IBaseDao<T> {
    /**
     * 添加数据
     * @param t
     * @throwsSQLException
     */
    void insert(T t) throws Exception;

    /**
     * 修改数据
     * @param t
     */
    void update(T t) throws Exception;

    /**
     * 修改数据
     */
    void updateById(@Param("id") Long id, @Param("t") T t) throws SQLException;
    /**
     * 删除数据
     * @param id
     */
    void deleteById(Long id) throws Exception;

    /**
     * 按Id查询
     * @param id
     */
    T selectById(Long id) throws Exception;

    void batchDelete(@Param("list") Object[] ids);
}
